<html>
  <head>

    <link href="themes/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
	<link href="Scripts/jtable/themes/standard/blue/jtable_blue.css" rel="stylesheet" type="text/css" />
	<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="Scripts/jtable/jquery.jtable.js" type="text/javascript"></script>

  </head>
  <body>
    <div>
        <a href="index.php?logout=true">Logout</a>
        <p><hr /></p>
    </div>
    <div id="UsersTableContainer" style="width: 700px;"></div>
    <br><br><br>
    <div id="MessageTableContainer" style="width: 700px;"></div>
	<script type="text/javascript">

        $(document).ready(function () {
		    //Prepare jTable
			$('#UsersTableContainer').jtable({
				title: 'Users Board',
				actions: {
                        listAction:   'actions/User.php?action=list',
                        deleteAction: 'actions/User.php?action=delete',
                        updateAction: 'actions/User.php?action=update',
                        createAction: 'actions/User.php?action=create'
				},
				fields: {
                        id: {
                            type: 'hidden',
                            key: true,
                            create: false,
                            edit: false,
                            list: false
                        },
                        username: {
                            title: 'Username',
                            create: true,
                            edit: true
                        },
                        firstname: {
                            title: 'First Name',
                            create: true,
                            edit: true
                        },
                        lastname: {
                            title: 'Last Name',
                            create: true,
                            edit: true
                        },
                        password: {
                            title: 'Password',
                            type:'password',
                            create: true,
                            edit: true,
                            list: false
                        }
                }
        });
                    			//Load person list from server
		
        $('#UsersTableContainer').jtable('load');
		
    

});
        
         $(document).ready(function () {
			$('#MessageTableContainer').jtable({
				title: 'Message Board',
				actions: {
                        listAction:   'actions/Message.php?action=list',
                        deleteAction: 'actions/Message.php?action=delete',
                        createAction: 'actions/Message.php?action=create'
				},
				fields: {
                        id: {
                            key: true,
                            type: 'hidden',
                            create: true,
                            edit: true
                        },
                        title: {
                            title: 'Title',
                            create: true,
                            edit: true
                        },
                        content: {
                            title: 'Content',
                            type: 'textarea',
                            create: true,
                            edit: true
                        },
                        recordDate: {
                            title: 'Record date',
                            width: '10%',
                            type: 'date',
                            create: true,
                            edit: true
                        }
                }
        });
                    			//Load person list from server
			$('#MessageTableContainer').jtable('load');
		});
        
	</script>
  </body>
</html>
